from pyb import Timer, Pin, UART
import time

uart = UART(2, 9600)


def send_text(text):
    while 1 :
        uart.write(text)
        if uart.any() :
            reply = uart.readline()
            if reply == text :
                print(text)
                return (1)

def receive_text():
    while 1 :
        if uart.any():
            text = uart.readline()
            reply = text
            uart.write(reply)
            print(text)
            return (text)

